// pages/subscribe/subscribe.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tmplId: '9TekBb58fwHxA1iXMNg8WgvVAm1e4gOnmYrqcHMGClk'
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  handleSubscribe: function() {
    console.log(1)
    var that = this
    wx.requestSubscribeMessage({
      tmplIds: [this.data.tmplId],
      success: function(res){
        if (res[that.data.tmplId] == 'accept') {
          wx.request({
            url: '',
            data: {
              openid: '',
              tmplId: tmplId
            }
          })
        }
      }
    })
  }
})